package com.zahb.qadx.skeleton

import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import com.zahb.qadx.R
import io.supercharge.shimmerlayout.ShimmerLayout

/**
 * Created by Zdw on 2021/06/24 17:52
 */

class ChildShimmerLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) : ShimmerLayout(context, attrs, defStyle) {
    init {
        val array = context.obtainStyledAttributes(attrs, R.styleable.ChildShimmerLayout)
        val childBackgroundColor = array.getColor(R.styleable.ChildShimmerLayout_child_background_color, Color.LTGRAY)
        val child = View(context)
        child.setBackgroundColor(childBackgroundColor)
        addView(child, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
        array.recycle()
    }
}